package org.ryaness.demo.controller;

import org.ryaness.demo.service.DemoService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
public class DemoController {

    @Resource
    public DemoService demoService;

    @PostMapping("/upload")
    public String upload(@RequestParam("file") MultipartFile file){
        demoService.upload(file);
        return "ok";
    }

}
